from typing import TYPE_CHECKING, Union
from shared_enum import Layer

if TYPE_CHECKING:
    from frame_manager import FrameManager
    from frame_structure import Frame, Ontology

def get_marker_map(frame_manager: FrameManager, layer: Layer) -> dict[str, Union[Frame, Ontology]]:
    if Layer is Layer.Annotation:
        return frame_manager.marker_map
    elif Layer is Layer.Primary:
        return frame_manager.marker_map_primary
    elif Layer is Layer.Prototype:
        return frame_manager.marker_map_prototype
    else:
        raise ValueError